package main

import (
	"banzhuan-sys/pkg/config"
	"banzhuan-sys/router"
	"fmt"
	"github.com/gin-gonic/gin"
	ginSwagger "github.com/swaggo/gin-swagger"
	"net/http"
	swaggerFiles "github.com/swaggo/files"
	_ "banzhuan-sys/docs"
)


// @title Swagger Example API
// @version 1.0
// @description This is a sample server Petstore server.
// @termsOfService http://swagger.io/terms/

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host locahost:8092
// @BasePath /handle
func main() {

	config.Conf().Init()

	//db.RedisInit()
	//defer db.R.Close()

	g := gin.New()




	//url := ginSwagger.URL("/docs/swagger.json") // The url pointing to API definition
	g.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

	router.Load(g)

	err := http.ListenAndServe(":8092", g).Error()

	fmt.Println(err)

}
